package com.ycshihuo.shihuo.backend.service.sysUser.impl;

import com.ycshihuo.shihuo.backend.service.sysUser.SysUserService;
import com.ycshihuo.shihuo.data.dao.sysUser.SysUserMapper;
import com.ycshihuo.shihuo.data.model.sysUser.SysUser;
import com.ycshihuo.shihuo.util.PublicConstants;
import com.ycshihuo.shihuo.util.ReturnMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by guoxingye on 2016/10/10.
 */
@Service
public class SysUserServiceImpl implements SysUserService {
    @Autowired
    SysUserMapper sysUserMapper;
    @Override
    public ReturnMessage getSysUser() throws Exception {
        ReturnMessage msg = new ReturnMessage(PublicConstants.StatusCode.ERROR);
        List<SysUser> dataList = sysUserMapper.querySysUserList();
        if(dataList != null){
            msg.setCode(PublicConstants.StatusCode.SUCCESS);
            msg.add("dataList",dataList);
        }
        return msg;
    }
}
